home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / sky-chopper.swf / scripts / frame_336 / PlaceObject2_1904_115 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-09-29  |  6.0 KB  |  164 lines

  1. onClipEvent(enterFrame){
  2.    _root.framesSinceLastExplosion = _root.framesSinceLastExplosion + 1;
  3.    if(shielded)
  4.    {
  5.       _root.shield._x = this._x;
  6.       _root.shield._y = this._y;
  7.    }
  8.    if(!_root.landing)
  9.    {
  10.       if(_root.globaltime * 60 > 2)
  11.       {
  12.          living = _root.checkAlive(this);
  13.       }
  14.       if(living)
  15.       {
  16.          if(this._rotation == 0)
  17.          {
  18.             if(Key.isDown(17) && !_root.gamePaused)
  19.             {
  20.                if(framesSinceLastSecondaryShot >= 10)
  21.                {
  22.                   if(_root.secondary.getValue() == "mis1" && _root.sec_weapon_indc.unguided_pool > 0)
  23.                   {
  24.                      _root.sec_weapon_indc.unguided_pool--;
  25.                      if(heli.rl == "in")
  26.                      {
  27.                         _root.heli.rocketlauncher.gotoAndPlay("out");
  28.                      }
  29.                      rocketlauncher.flash.play();
  30.                      currentProjectile = _root.missile_unguided.duplicateMovieClip("projectile_" + ++projectileCount,o++);
  31.                      currentProjectile.moveX = 15;
  32.                      currentProjectile._x = this._x + 40;
  33.                      currentProjectile._y = this._y + 25;
  34.                      _root.projectileArray.push(currentProjectile);
  35.                      _root.missile_sound.start();
  36.                      _root.shots = _root.shots + 1;
  37.                      if(_root.sec_weapon_indc.unguided_pool == 0)
  38.                      {
  39.                         checkForOtherWeapon();
  40.                      }
  41.                   }
  42.                   if(_root.secondary.getValue() == "nuke" && _root.sec_weapon_indc.nuke_pool > 0)
  43.                   {
  44.                      _root.sec_weapon_indc.nuke_pool--;
  45.                      currentProjectile = _root.nuke.duplicateMovieClip("projectile_" + ++projectileCount,o++);
  46.                      currentProjectile.gotoAndPlay(2);
  47.                      currentProjectile.moveX = 15;
  48.                      currentProjectile._x = this._x - 10;
  49.                      currentProjectile._y = this._y + 20;
  50.                      _root.projectileArray.push(currentProjectile);
  51.                      _root.goingdown_sound.start();
  52.                      _root.shots = _root.shots + 1;
  53.                      if(_root.sec_weapon_indc.nuke_pool == 0)
  54.                      {
  55.                         checkForOtherWeapon();
  56.                      }
  57.                   }
  58.                   if(_root.secondary.getValue() == "mine" && _root.sec_weapon_indc.mines_pool > 0)
  59.                   {
  60.                      _root.sec_weapon_indc.mines_pool--;
  61.                      currentmine = _root.mine.duplicateMovieClip("mine_" + ++_root.mineCount,o++);
  62.                      currentmine._x = this._x;
  63.                      currentmine._y = this._y;
  64.                      _root.projectileArray.push(currentmine);
  65.                      _root.deploy_sound.start();
  66.                      _root.shots = _root.shots + 1;
  67.                      if(_root.sec_weapon_indc.mines_pool == 0)
  68.                      {
  69.                         checkForOtherWeapon();
  70.                      }
  71.                   }
  72.                   if(_root.secondary.getValue() == "mis2" && _root.sec_weapon_indc.guided_pool > 0)
  73.                   {
  74.                      _root.sec_weapon_indc.guided_pool--;
  75.                      _root.missile_sound.start();
  76.                      if(heli.rl == "in")
  77.                      {
  78.                         _root.heli.rocketlauncher.gotoAndPlay("out");
  79.                      }
  80.                      rocketlauncher.flash.play();
  81.                      currentMi = _root.missile.duplicateMovieClip("homingMissile_" + ++_root.missileCount,o++);
  82.                      currentMi._x = this._x + 30;
  83.                      currentMi._y = this._y + 25;
  84.                      currentMi.initSpeed = 5;
  85.                      currentMi.initAngle = 0;
  86.                      currentMi.step = 0;
  87.                      _root.projectileArray.push(currentMi);
  88.                      currentMi.initXoffset = currentMi.destX - currentMi._x;
  89.                      currentMi.initYoffset = currentMi.destY - currentMi._y;
  90.                      _root.shots = _root.shots + 1;
  91.                      if(_root.sec_weapon_indc.guided_pool == 0)
  92.                      {
  93.                         checkForOtherWeapon();
  94.                      }
  95.                   }
  96.                   framesSinceLastSecondaryShot = 0;
  97.                }
  98.             }
  99.          }
  100.          if(Key.isDown(32) && !_root.gamePaused)
  101.          {
  102.             if(_root.laserIsCharged)
  103.             {
  104.                _root.laser._x = this._x + 550;
  105.                _root.laser._y = this._y + 20;
  106.                _root.laser.gotoAndPlay(1);
  107.                _root.bounce_sound.start();
  108.                _root.laserEnabler.gotoAndPlay(1);
  109.                _root.heli.lasergun.gotoAndPlay("retract");
  110.                laserprotect = 0;
  111.                _root.laserIsCharged = false;
  112.             }
  113.             else
  114.             {
  115.                laserprotect++;
  116.                if(laserprotect >= 10 && framesSinceLastShot >= 5)
  117.                {
  118.                   _root.shoot();
  119.                   framesSinceLastShot = 0;
  120.                }
  121.             }
  122.          }
  123.       }
  124.    }
  125.    if(!_root.landing)
  126.    {
  127.       framesSinceLastShot++;
  128.       framesSinceLastSecondaryShot++;
  129.       if(slowdownX || slowdownY)
  130.       {
  131.          this.moveY /= 1.2;
  132.          this.moveX /= 1.2;
  133.          if(this.moveX <= 1 && this.moveX >= -1)
  134.          {
  135.             this.moveX = 0;
  136.             slowdownX = false;
  137.          }
  138.          if(this.moveY <= 1 && this.moveY >= -1)
  139.          {
  140.             this.moveY = 0;
  141.             slowdownY = false;
  142.          }
  143.       }
  144.       this._x += int(this.moveX);
  145.       this._y += int(this.moveY);
  146.       if(this._x > 510)
  147.       {
  148.          this._x = 510;
  149.       }
  150.       if(this._x < 50)
  151.       {
  152.          this._x = 50;
  153.       }
  154.       if(this._y > 350)
  155.       {
  156.          this._y = 350;
  157.       }
  158.       if(this._y < 10)
  159.       {
  160.          this._y = 10;
  161.       }
  162.    }
  163. }
  164.